package com.junittest.code;

import java.util.Calendar;

public class Person {
	
	private String firstName;
	private String lastName;
	private int age;
	
	public Person(String firstName, String lastName, int age) 
	{
		this.firstName = firstName;
		this.lastName = lastName;
		this.age = age;
	}
	
	public String getName()
	{
		return this.firstName + " " + this.lastName;
	}
	
	public int getYearOfBirth()
	{
		return Calendar.getInstance().get(Calendar.YEAR) - this.age;
	}
	
	public String getInitials()
	{
		return String.format("%s%s",
				Character.toUpperCase(this.firstName.charAt(0)),
				Character.toUpperCase(this.lastName.charAt(0)));
	}
	
	public String getLameLeetName()
	{
		return String.format("%s %s", this.firstName, this.lastName).replace("e", "3").replace("a", "4");
	}
	
	public String getNickname()
	{
		String yearEnd = String.valueOf(this.getYearOfBirth()).substring(2, 4);
		return String.format("%s-%s", this.firstName.toLowerCase(), yearEnd);
	}
	
}
